#!/bin/bash

read -p "请输入文件名：" filename
read -p "请输入数据：" data
if [ -w $filename -a -n $data ]; then
	echo $data
	echo $data > $filename
	echo "成功"
else
	echo "失败"
fi
